/// 微信聊天列表项，数据结构
class ChatListItemModel {
  final String avatarUrl; // 头像
  final String userName; // 昵称
  final String message; // 消息
  final String msgTime; // 时间
  final bool? isRead; // 是否已读
  final bool? isShield; // 是否屏蔽

  ChatListItemModel({
    required this.avatarUrl,
    required this.userName,
    required this.message,
    required this.msgTime,
    this.isRead = true,
    this.isShield = false
  });

  factory ChatListItemModel.fromJson(Map<String, dynamic> json) {
    return ChatListItemModel(
      avatarUrl: json['avatarUrl'],
      userName: json['userName'],
      message: json['message'],
      msgTime: json['msgTime'],
      isRead: json['isRead'] ?? true,
      isShield: json['isShield'] ?? false,
      // isShield: json['isShield'] == null ? false : json['isShield'] as bool,
    );
  }
}